﻿using System;
using System.ServiceModel;
using System.Windows.Forms;
using ControlPanel.ServiceReference;

namespace ControlPanel
{
    public partial class Form1 : Form
    {
        private readonly HookClient client;

        public Form1()
        {
            InitializeComponent();
            var context = new InstanceContext(new ServiceCallback());
            client = new HookClient(context);
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            string channelName = txtChannel.Text;

            client.Publish(channelName, 1);
        }

        private void btnStop_Click(object sender, EventArgs e)
        {
            string channelName = txtChannel.Text;

            client.Publish(channelName, 2);
        }

        private void btnReceiveEmail_Click(object sender, EventArgs e)
        {
            string channelName = txtChannel.Text;

            client.Publish(channelName, 3);
        }

        private void btnScreenShot_Click(object sender, EventArgs e)
        {
            string channelName = txtChannel.Text;


            client.ScreenShot(channelName);
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            string channelName = txtChannel.Text;

            client.Publish(channelName, 4);
        }

        private void btnHidden_Click(object sender, EventArgs e)
        {
            string channelName = txtChannel.Text;

            client.Publish(channelName, 5);
        }

        private void btnShow_Click(object sender, EventArgs e)
        {
            client.Publish(txtChannel.Text, 5);
        }
    }
}